<?
/*权限集对应名称*/
$_auth_group=array(1=>"销售管理",2=>"产品管理","a"=>"直销管理",3=>"交易管理",4=>"合作伙伴",5=>"财务管理",6=>"系统设置",7=>"码商管理",8=>'统计分析',);

/**
 *权限配置数组,键值数组.
 *@example verify权限键=>array配置数组
 *"verify"=>array(
 *			"group"=>1,   			//所属权限集
 *			"limit"=>"0,2,9",       //可访问会员权限
 *			"title"=>"票务验证",    //标题，用在左边栏和员工权限分配页面
 *			"left"=>"none"          //是否在左边栏显示,[注]默认不含该键值，需不显示请添加并标注为none
 *			"url"=>array(           //权限包含页面，[注]第一个页面将在左边栏显示。
 *				"terminal_chk.html" 
 *			)
 *		)
 *@var array
 */
$_auth=array(
	"verify"=>array(
			"group"=>1,
			"limit"=>"0,2,3,9",
			"title"=>"票券验证",
			"url"=>array(
				"terminal_chk.html"
			)
		),
	"pro"=>array(
			"group"=>1,
			"limit"=>"0,1",
			"title"=>"产品预订",
			"url"=>array(
				"plist.html"
			)
		),
	"order"=>array(
			"group"=>1,
			"limit"=>"0,1,5",
			"title"=>"已买到的产品",
			"url"=>array(
				"buyProduct.html"
			)
		),
	"sale"=>array(
			"group"=>1,
			"limit"=>"0,1,7,9",
			"title"=>"已卖出的产品",
			"url"=>array(
				"saleProduct.html"
			)
		),
    "sale_land"=>array(
			"group"=>1,
			"limit"=>"2,3",
			"title"=>"已卖出的产品",
			"url"=>array(
				"saleProduct_land.html"
			)
		),
	"prod_sale"=>array(
			"group"=>1,
			"limit"=>"1",
			"title"=>"转分销产品",
			"url"=>array(
				"prod_sale.html"
			)
		),
	"terchange"=>array(
			"group"=>1,
			"limit"=>"0,1,2,3,9",
			"title"=>"异常订单处理",
			"url"=>array(
				"terchange.html"
			)
		),
		// "exportCode"=>array(
			// "group"=>"a",
			// "limit"=>"0,1",
			// "title"=>"团购导码",
			// "url"=>array(
				// "exportCode.html"
			// )
		// ),
        "domainConf"=>array(
			"group"=>"a",
			"limit"=>"0,1",
			"title"=>"B2C店铺配置",
			"url"=>array(
				"domainConf.html"
			)
		),
		"qunaer"=>array(
			"group"=>"a",
			"limit"=>"0,1",
			"title"=>"团购配置",
			"url"=>array(
				"qunaer.html",
				
			)
		),
	// "code2Order"=>array(
			// "group"=>1,
			// "limit"=>"0,2,9",
			// "title"=>"反查订单",
			// "url"=>array(
				// "code2Order.html"
			// )
		// ),
	"modify"=>array(
			"group"=>1,
			"limit"=>"0,1",
			"left"=>"none",
			"title"=>"终端撤改",
			"url"=>array(
				"terchange.html"
			)
		),
	"release"=>array(
			"group"=>2,
			"limit"=>"0",
			"title"=>"发布新产品",
			"url"=>array(
				"prod_type.html"
			)
		),
	"pft_resource.html"=>array(
			"group"=>2,
			"limit"=>"9",
			"title"=>"资源库列表",
			"url"=>array(
				"pft_resource.html"
			)
		),
	"upProd"=>array(
			"group"=>2,
			"limit"=>"0,9",
			"title"=>"出售中产品",
			"url"=>array(
				"prodlists.html",
			)
		),
	"downProd"=>array(
			"group"=>2,
			"limit"=>"0,9",
			"title"=>"仓库中产品",
			"url"=>array(
				"prodlists_s.html"
			)
		),
	"terminal_share_list"=>array(
            "group"=>2,
            "limit"=>"9",
            "title"=>"终端共享列表",
            "url"=>array(
                "terminal_share_list.html"
            )
		),
    "terminal_conf"=>array(
			"group"=>2,
			"limit"=>"9",
			"title"=>"软终端验证设置",
			"url"=>array(
				"terminal_conf.html"
			)
		),
	"ssss"=>array(
			"group"=>"a",
			"limit"=>"0,1",
			"title"=>"去啊/淘宝/天猫配置",
			"url"=>array(
				"tao_apply.html" 
			)
		),

	"trecord"=>array(
			"group"=>3,
			"limit"=>"0,1,2,3,5,7,9",
			"title"=>"交易记录",
			"url"=>array(
				"trecord.html"
			)
		),
	"accountTrecord"=>array(
			"group"=>3,
			"limit"=>"9",
			"title"=>"会员交易记录",
			"url"=>array(
				"accountTrecord.html"
			)
		),
	"you_know"=>array(
			"group"=>6,
			"limit"=>"9",
			"title"=>"查错",
			"url"=>array(
				"admin/you_know.html"
			)
		),
	"trecordCount"=>array(
			"group"=>3,
			"limit"=>"9",
			"title"=>"交易记录统计",
			"url"=>array(
				"trecordCount.html",
				
			)
		),
	"accountSearch"=>array(
			"group"=>3,
			"limit"=>"9",
			"title"=>"账户余额查询",
			"url"=>array(
				"accountSearch.html"
			)
		),
	"accourtmanage"=>array(
			"group"=>3,
			"limit"=>"0,1,2,3,5,7,9",
			"title"=>"提现/充值/转账",
			"url"=>array(
				"accourtmanage.html",
				"withdraw.html",
				"transfer.html",
				"recharge.html",
			)
		),
	"refund"=>array(
			"group"=>3,
			"limit"=>"9",
			"title"=>"提现申请列表",
			"url"=>array(
				"refund.html"
			)
		),
	"lowPartner"=>array(
			"group"=>4,
			"limit"=>"7",
			"title"=>"下属成员",
			"url"=>array(
				"partner.html",
				"partner.php"
			)
		),
	"fxPartner"=>array(
			"group"=>4,
			"limit"=>"0,1",
			"title"=>"合作分销商",
			"url"=>array(
				"partner.html",
				"partner.php"
			)
		),
	"supplyPartner"=>array(
			"group"=>4,
			"limit"=>"0,1",
			"title"=>"合作供应商",
			"url"=>array(
				"partner.html?dtype=1",
				"partner.php"
			)
		),
	"supply_apply"=>array(
			"group"=>4,
			"limit"=>"9",
			"title"=>"供应商申请",
			"url"=>array(
				"supply_apply.html"
			)
		),
	"addlow"=>array(
			"group"=>4,
			"limit"=>"0,1",
			"title"=>"添加分销商",
			"url"=>array(
				"distributor_add.html"
			)
		),
	"mems"=>array(
			"group"=>4,
			"limit"=>"9",
			"title"=>"会员管理",
			"target"=>"_blank",
			"url"=>array(
				"/admin/mems.php"
			)
		),
	"New_notice"=>array(
			"group"=>6,
			"limit"=>"9",
			"title"=>"平台升级",
			"target"=>"_blank",
			"url"=>array(
				"pft_announce.html"
			)
		),
	"addalliance"=>array(
			"group"=>4,
			"limit"=>"9",
			"title"=>"创建联盟",
			"url"=>array(
				"alliance_add.html"
			)
		),
	"alliance_m"=>array(
			"group"=>4,
			"limit"=>"9",
			"title"=>"联盟管理",
			"url"=>array(
				"alliance_manage.html"
			)
		), 
	"addgroup"=>array(
			"group"=>4,
			"limit"=>"9",
			"title"=>"添加集团",
			"url"=>array(
				"group_add.html"
			)
		),	
	"getbill"=>array(
			"group"=>3,
			"limit"=>"0,1",
			"title"=>"应收款账单",
			"url"=>array(
				"getbill.html",
			)
		),
	"paybill"=>array(
			"group"=>3,
			"limit"=>"0,1",
			"title"=>"应付款账单",
			"url"=>array(
				"paybill.html"
			)
		),
	"fees"=>array(
			"group"=>3,
			"limit"=>"9",
			"title"=>"费用配置",
			"url"=>array(
				"fees.html"
			)
		),
    "ali_refund"=>array(
			"group"=>3,
			"limit"=>"9",
			"title"=>"在线支付退款申请",
            "target"=>"_blank",
			"url"=>array(
				"/admin/ali_refund.html"
			)
		),
    "orderReport"=>array(
        "group"=>8,
        "limit"=>"0,1,7,9",
        "target"=>"_blank",
        "title"=>"销售报表",
//            "left"=>"none",
        "url"=>array(
            "orderReport.html"
        )
    ),
    "orderReport_land"=>array(
        "group"=>8,
        "limit"=>"2,3",
        "target"=>"_blank",
        "title"=>"销售报表",
        "url"=>array(
            "orderReport_land.html"
        )
    ),
    "orderReport_Com"=>array(
        "group"=>8,
        "limit"=>"0,1,3,9",
        "target"=>"_blank",
        "title"=>"数据罗盘",
        "url"=>array(
            "orderReport_Com.html"
        )
    ),
    "buyOrderReport"=>array(
        "group"=>8,
        "limit"=>"0,1",
        "target"=>"_blank",
        "title"=>"购买报表",
        "url"=>array(
            "buyOrderReport.html"
        )
    ),
    "checkReport"=>array(
        "group"=>8,
        "limit"=>"9",
        "target"=>"_blank",
        "title"=>"检票报表",
        "url"=>array(
            "web/rebuild/yyl/count/checkReport.html"
        )
    ),
	"file"=>array(
			"group"=>6,
			"title"=>"基本信息",
			"limit"=>"0,1,2,3,5,7,9",
			"url"=>array(
				"account_info.html",
				"enterprise_info.html",
				"contact.html",
				"certifi.html",
				"account_info.php"
			)
		),
	"ps"=>array(
			"group"=>6,
			"title"=>"修改密码",
			"limit"=>"0,1,2,3,5,7,9",
			"url"=>array(
				"chPs.html"
			)
		),
	"notice"=>array(
			"group"=>6,
			"title"=>"系统通知",
			"limit"=>"0,1,9,7",
			"url"=>array(
				"notice.html"
			)
		),
	"oper"=>array(
			"group"=>6,
			"limit"=>"0,1,7,9",
			"title"=>"员工管理",
			"url"=>array(
				"operlist.html",
				"powguanli.html",
				"powguanli.php",
				"operatorRecord.html"
			)
		),
	"soap"=>array(
			"group"=>6,
			"limit"=>"0,1",
			"title"=>"对接接口",
			"url"=>array(
				"soap.html",
				"soap.php"
			)
		),
	"smsConfig"=>array(
			"group"=>6,
			"limit"=>"9",
			"title"=>"短信模板",
			"url"=>array(
				"smsConfig.html"
			)
		),
	"macode"=>array(
			"group"=>7,
			"limit"=>"9",
			"title"=>"淘宝码商管理",
			"url"=>array(
				"tao_manage.html",
				"partner.php"
			)
		),
    "wx"=>array(
        "group"=>7,
        "limit"=>"9",
        "title"=>"公众号绑定列表",
        "target"=>"_blank",
        "url"=>array(
            "/admin/wx.php"
        )
    ),
    "page_statics"=>array(
        "group"=>8,
        "limit"=>"9",
        "title"=>"页面点击统计",
        "target"=>"_blank",
        "url"=>array(
            "/admin/page_statics.php"
        )
    ),
	"qunaerp"=>array(
			"group"=>7,
			"limit"=>"9",
			"title"=>"去哪儿商家管理",
			"url"=>array(
				"qunaer_manage.html",
			)
		),
	"union" => array(
		"group"=>4,
		"limit"=>"0,1",
		"title"=>"我的联盟",
		"url"=>array(
			"union.html"
		)
	),
	"channels_conf"=>array(
		"group"=>2,
		"limit"=>"0,1,9",
		"title"=>"销售渠道配置",
		"url"=>array(
			"channels_conf.html"
		)
	),
);
if ($_SERVER['HTTP_HOST']=='www.12301.cc') {
    $_auth["wechat"] = array(
        "group"=>"a",
        "limit"=>"0,1",
        "target"=>"_blank",
        "title"=>"微信公众号配置",
        "url"=>array(
            "module/wechat/index.html"
            //http://www.12301.cc/module/wechat/index.html
        )
    );
}
$ali_refund_array = array(7517,24863,4354);
if(in_array($_SESSION['sid'],$ali_refund_array)){
    $_auth['qunaerp'] = array(
			"group"=>3,
			"limit"=>"0,1",
			"title"=>"会员退款审核",
			"url"=>array(
				"ali_refund.html"
			)
		);
}

if(in_array($_SESSION['sid'], array(1433,4971,3385,55,6970))){
	$_auth['coupon'] = array(
		"group"=>"a",
		"limit"=>"0,1",
		"target"=>"_blank",
		"title"=>"优惠券管理",
		"url"=>array('publish_manage.html')
	);
}


$allow = include '/var/www/html/new/d/qunar/export_array.php'; 
//$allow = array(502140,123545,123624,123651,200456,100010,200144,'admin',100019,'pzp123','guoyajuan','lihong','wangxuemei','hanmeng','zhaojing','hejingping',123514,504261,200566,123960,100001);
if(in_array($_SESSION['saccount'],$allow)){
	$_auth['exportCode'] = array(
		"group"=>"a",
		"limit"=>"0,1",
		"title"=>"团购导码",
		"url"=>array(
			"exportCode.html"
		)
	);
}
// 会员卡账号
$show_card_account_list = array(
	1433,55,6970,52145
);
if(in_array($_SESSION['sid'], $show_card_account_list)){
	$_auth['mcard_list'] = array(
		"group"=>4,
		"limit"=>"0,1",
		"title"=>"会员卡",
		"url"=>array(
			"mcard_list.html"
		)
	);
	$_auth['prod_restrict'] = array(
		"group"=>4,
		"limit"=>"0,1",
		"title"=>"会员卡限制",
		"url"=>array(
			"prod_restrict.html"
		)
	);
}
// 联盟账号登录
if(isset($_SESSION['alliance']) && $_SESSION['sid']!=1433){
//	unset($_auth['fxPartner']);
	unset($_auth['addlow']);
	unset($_auth['pro']);
	unset($_auth['verify']);
	unset($_auth['exportCode']);
	unset($_auth['domainConf']);
	unset($_auth['qunaer']);
	unset($_auth['release']);
	unset($_auth['downProd']);
	unset($_auth['ssss']);
	unset($_auth['wechat']);
	$_auth['alliance'] = array(
			"group"=>4,
			"limit"=>"0",
			"title"=>"联盟信息",
			"url"=>array(
				"alliance.html"
			)
		);

	$_auth['alliance_members'] = array(
			"group"=>4,
			"limit"=>"0",
			"title"=>"联盟成员",
			"url"=>array(
				// "partner_alliance.html"
				"alliance_mem.html"
			)
		);
}


if($_SESSION['sid'] == 55){//三亚先行
    unset($_auth['trecord']);
    unset($_auth['accourtmanage']);
    unset($_auth['union']);
//    unset($_auth['mcard_list']);
}
//if ($_SESSION['sid']==108) {
//    $_auth=array(
//        "verify"=>array(
//            "group"=>1,
//            "limit"=>"0,2,3,9",
//            "title"=>"票券验证",
//            "url"=>array(
//                "terminal_chk.html"
//            )
//        ),
//        "pro"=>array(
//            "group"=>1,
//            "limit"=>"0,1",
//            "title"=>"产品预订",
//            "url"=>array(
//                "plist.html"
//            )
//        ),
//		"fxPartner"=>array(
//			"group"=>4,
//			"limit"=>"0",
//			"title"=>"合作分销商",
//			"url"=>array(
//				"partner.html",
//				"partner.php"
//			)
//		),
//        "file"=>array(
//            "group"=>6,
//            "title"=>"基本信息",
//            "limit"=>"0,1,2,3,5,7,9",
//            "url"=>array(
//                "account_info.html",
//                "enterprise_info.html",
//                "contact.html",
//                "certifi.html",
//                "account_info.php"
//            )
//        ),
//        "ps"=>array(
//            "group"=>6,
//            "title"=>"修改密码",
//            "limit"=>"0,1,2,3,5,7,9",
//            "url"=>array(
//                "chPs.html"
//            )
//        ),
//        "notice"=>array(
//            "group"=>6,
//            "title"=>"系统通知",
//            "limit"=>"0,1,9,7",
//            "url"=>array(
//                "notice.html"
//            )
//        ),
//        "oper"=>array(
//            "group"=>6,
//            "limit"=>"0,1,7,9",
//            "title"=>"员工管理",
//            "url"=>array(
//                "operlist.html",
//                "powguanli.html",
//                "powguanli.php",
//                "operatorRecord.html"
//            )
//        ),
//        "soap"=>array(
//            "group"=>6,
//            "limit"=>"0,1",
//            "title"=>"对接接口",
//            "url"=>array(
//                "soap.html",
//                "soap.php"
//            )
//        ),
//    );
//    //交易记录，合作分销商，已卖出产品，已买到产品
////    unset($_auth['trecord']);
////    unset($_auth['fxPartner']);
////    unset($_auth['sale']);
////    unset($_auth['order']);
////    unset($_auth['orderReport']);
//    //产品预定  验证  系统设置
//    //销售管理
//
//}
			  
/*
$leftNaviArray=array(
				array("title"=>"票券验证","url"=>"terminal_chk.html","group"=>1),
				array("title"=>"产品预订","url"=>"plist.html","group"=>1),
				array("title"=>"已买到的产品","url"=>"buyProduct.html","group"=>1),
				array("title"=>"已卖出的产品","url"=>"saleProduct.html","group"=>1),
				array("title"=>"销售报表","url"=>"#","limit"=>"","group"=>1),
				array("title"=>"终端撤改","url"=>"terchange.html","group"=>1),
				
				array("title"=>"发布新产品","url"=>"prod_type.html","group"=>2),
				array("title"=>"出售中的产品","url"=>"prodlists.html","group"=>2),
				array("title"=>"仓库中的产品","url"=>"prodlists_s.html","group"=>2),
				

				array("title"=>"交易记录","url"=>"trecord.html","group"=>3),
				array("title"=>"提现/充值/转账","url"=>"accourtmanage.html","group"=>3),
				// array("title"=>"充值","url"=>"recharge.html","limit"=>"0,1,2,5,7","part"=>"jygl"),
				// array("title"=>"转账","url"=>"transfer.html","limit"=>"0,1,2,5,7","part"=>"jygl"),
				array("title"=>"提现申请列表","url"=>"refund.html","group"=>3),

				array("title"=>"合作供应商","url"=>"partner.html?dtype=1","group"=>4),
			/* 	array("title"=>"产品分销筛选","url"=>"#","limit"=>"1","part"=>"hzhb"),
				array("title"=>"产品分销申请","url"=>"#","limit"=>"1","part"=>"hzhb"), 
				array("title"=>"下属成员","url"=>"partner.html","group"=>4),
				array("title"=>"合作分销商","url"=>"partner.html","group"=>4),
				//array("title"=>"分销商审核","url"=>"#","group"=>4),
				array("title"=>"添加分销商","url"=>"distributor_add.html","group"=>4),
				array("title"=>"会员管理","url"=>"/admin/mems.php","target"=>"_blank","group"=>4),
				array("title"=>"添加集团","url"=>"group_add.html","group"=>4),
				array("title"=>"供应商申请","url"=>"supply_apply.html","group"=>4),
				array("title"=>"应收款账单","url"=>"getbill.html","group"=>5),
				array("title"=>"应付款账单","url"=>"paybill.html","group"=>5),
				array("title"=>"费用配置","url"=>"fees.html","group"=>5),				
				array("title"=>"基本信息","url"=>"account_info.html","group"=>6),
				array("title"=>"修改密码","url"=>"chPs.html","group"=>6),
				array("title"=>"系统通知","url"=>"notice.html","group"=>6),
				//array("title"=>"网店管理","url"=>"#","group"=>6),
				array("title"=>"员工管理","url"=>"operlist.html","group"=>6),
				);
				
/*			  
$str="select m.id from pft_member_relationship r join pft_member m on r.son_id=m.id where son_id=".$_SESSION['memberID'].
    " and r.status=0 and m.status=0 and r.ship_type=0 limit 1";
$GLOBALS['le']->query($str);
if($GLOBALS['le']->fetch_assoc()) $hasApplier=1;*/
?>